# $Id$
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Maintainer: Thomas Baechler <thomas@archlinux.org>

pkgname=linux-manpages
pkgver=4.10
pkgrel=1
pkgdesc="Kernel hackers manual - Section 9 manpages that comes with the Linux kernel."
arch=('any')
url="http://www.kernel.org"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl')
replaces=('kernel26-manpages')
conflicts=('kernel26-manpages')
provides=('kernel26-manpages')
options=('!zipman')
# https://www.kernel.org/pub/linux/kernel/v4.x/sha256sums.asc
source=("https://www.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.xz")
sha256sums=('3c95d9f049bd085e5c346d2c77f063b8425f191460fcd3ae9fe7e94e0477dc4b')

build() {
  cd "${srcdir}/linux-$pkgver"
  make mandocs
}

package() {
  cd "${srcdir}/linux-$pkgver"
  # fix install path
  sed -i -e "s:/usr/local/man/man9/:${pkgdir}/usr/share/man/man9/:g" Documentation/DocBook/Makefile
  make installmandocs

  #install -d "${pkgdir}/usr/share/man/man9/"
  #install "${srcdir}"/linux-$pkgver/Documentation/DocBook/man/*/*.9.gz "${pkgdir}/usr/share/man/man9/"

#  find "${pkgdir}" -type f -exec chmod 644 {} \;
}
